# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models
import django.utils.timezone as timezone


# Create your models here.
class StartOver(models.Model):
    device = models.IntegerField()
    app = models.IntegerField()
    cold_boot = models.CharField(max_length=255)
    warn_boot = models.CharField(max_length=255)
    result = models.CharField(max_length=255)
    detail = models.CharField(max_length=255)
    version = models.CharField(max_length=255)
    timestamp = models.DateTimeField(default=timezone.now)

    class Meta:
        db_table = 'qa_interface_startup'


class AppCpu(models.Model):
    device = models.IntegerField()
    app = models.IntegerField()
    avgcpu = models.CharField(max_length=255)
    model = models.CharField(max_length=255)
    case = models.CharField(max_length=255)
    maxcpu = models.CharField(max_length=255)
    result = models.CharField(max_length=255)
    detail = models.CharField(max_length=1000)
    version = models.CharField(max_length=255)
    timestamp = models.DateTimeField(default=timezone.now)

    class Meta:
        db_table = 'qa_interface_appcpu'


class AppMen(models.Model):
    device = models.IntegerField()
    app = models.IntegerField()
    avgmen = models.CharField(max_length=255)
    model = models.CharField(max_length=255)
    case = models.CharField(max_length=255)
    maxmen = models.CharField(max_length=255)
    result = models.CharField(max_length=255)
    detail = models.CharField(max_length=255)
    version = models.CharField(max_length=255)
    timestamp = models.DateTimeField(default=timezone.now)


# 内存
class AppMemory(models.Model):
    device = models.IntegerField()
    app = models.IntegerField()
    avgmem = models.CharField(max_length=255)
    model = models.CharField(max_length=255)
    case = models.CharField(max_length=255)
    maxmem = models.CharField(max_length=255)
    result = models.CharField(max_length=255)
    detail = models.CharField(max_length=1000)
    version = models.CharField(max_length=255)
    timestamp = models.DateTimeField(default=timezone.now)

    class Meta:
        db_table = 'qa_interface_appmemory'


# 电量
class AppElectricity(models.Model):
    device = models.IntegerField()
    app = models.IntegerField()
    startbatter = models.CharField(max_length=255)
    model = models.CharField(max_length=255)
    case = models.CharField(max_length=255)
    overbatter = models.CharField(max_length=255)
    subtractbatter = models.CharField(max_length=255)
    result = models.CharField(max_length=255)
    detail = models.CharField(max_length=1000)
    version = models.CharField(max_length=255)
    timestamp = models.DateTimeField(default=timezone.now)

    class Meta:
        db_table = 'qa_interface_appelectricity'


# 流量
class AppFlow(models.Model):
    device = models.IntegerField()
    app = models.IntegerField()
    maxflowup = models.CharField(max_length=255)
    maxflowdown = models.CharField(max_length=255)
    model = models.CharField(max_length=255)
    case = models.CharField(max_length=255)
    agvflowup = models.CharField(max_length=255)
    agvflowdown = models.CharField(max_length=255)
    result = models.CharField(max_length=255)
    detail = models.CharField(max_length=1000)
    version = models.CharField(max_length=255)
    timestamp = models.DateTimeField(default=timezone.now)

    class Meta:
        db_table = 'qa_interface_appflow'
